package com.example.springboot.dubbo.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import com.test.dubbo.bean.UserAddress;
import com.test.dubbo.service.OrderService;
import com.test.dubbo.service.UserService;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author mark
 * @Title:
 * @Description:
 * @date 2020/9/30 00309:20
 */
@Component
@Service
public class OrderServiceImpl implements OrderService {

    @Reference(loadbalance="random",timeout=1000) //dubbo直连
    UserService userService;



    @Override
    public List<UserAddress> initOrder(String userId) {
        //1、查询用户的收货地址
        List<UserAddress> addressList = userService.getUserAddressList(userId);
        return addressList;
    }
}
